import React from 'react'
import Login from '../pages/login/index'
import * as userActionCreators from '../store/actions/user'
import {bindActionCreators} from 'redux'
import {connect} from 'react-redux'
class LoginContainer extends React.Component{

    static navigationOptions = {
        headerTitle:'登录'
    }

    render(){
        return (
            <Login {...this.props} />
        )
    }

}

const mapStateToProps =  state => {
    return state.user
}

const mapDispatchToProps = dispatch => {
    const userActions = bindActionCreators(userActionCreators,dispatch)
    return {userActions,dispatch};
}

export default connect(mapStateToProps,mapDispatchToProps)(LoginContainer)